import React from 'react';
import './App.scss';

// 导入路由
import { Route, Switch,Redirect  } from 'react-router-dom';

// 注意：此处需要导入 Router

import  {customHistory}  from '@/utils/history'

import { Router } from 'react-router-dom';

import Login from './pages/Login';
import Layout from './pages/Layout';

export default function App() {
  return (
    <Router  history={ customHistory} >
      <div className="app">
        <Switch>
          <Route exact  path='/' render={()=> <Redirect to="/home" />} />
          <Route path="/home" component={Layout}></Route>
          <Route path="/login" component={Login}></Route>
        </Switch>
      </div>
    </Router>
  );
}
